<?php

include ('../classes/class.mysql.php');

$mysql = new MySQL();

$res = $mysql->query("SELECT * FROM boletos");

$data;
$i = 0;

while(@($r = $mysql->fetch_array($res))) {
    $data[$i] = array (
        "nombre_comprador" => $r["nombre_comprador"],
        "telefono" => $r["telefono"],
        "correo" => $r["correo"],
        "id_boleto" => $r["id_boleto"],
        "valor" => $r["valor"],
        "id_usuario" => $r["fk_id_usuario"],
        "fecha" => $r["fecha"],
        "num_boleto" => $r["num_boleto"]
    );
    $i++;
}

$mysql->close();

echo json_encode($data);

?>
